package com.example.framework2002.mvvm;

import com.example.framework2002.http.Api;
import com.example.framework2002.http.Http;
import com.example.framework2002.kind.Fenl;
import com.example.lib_cson.mvvm.model.IModel;


import io.reactivex.Observer;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.schedulers.Schedulers;

public class MyModel implements IModel {
    public void getFen(Observer<Fenl> observer, int type){
        Http.getInstance().getRetrofit()
                .create(Api.class)
                .getFenl(type)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(observer);
    }

}
